listitemwidget: Match activation conditions
authorMatthias Clasen <mclasen@redhat.com>
Sun, 13 Jun 2021 12:02:06 +0000 (08:02 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Sun, 13 Jun 2021 12:02:06 +0000 (08:02 -0400)
Make the conditions used for activation in the single-
and double-click case properly match, so that it is
obvious that we won't trigger both of them.

gtk/gtklistitemwidget.c

index 2a98ef5c87e83bb900855b65f542e2cc20fc0eae..bbf56b72934eab04ccf825cbb5fa286aafb88091 100644 (file)
@@ -356,14 +356,16 @@ gtk_list_item_widget_click_gesture_released (GtkGestureClick   *gesture,
 {
   GtkListItemWidgetPrivate *priv = gtk_list_item_widget_get_instance_private (self);
 
-  if (priv->single_click_activate)
+  if (!priv->list_item || priv->list_item->activatable)
     {
-      gtk_widget_activate_action (GTK_WIDGET (self),
-                                  "list.activate-item",
-                                  "u",
-                                  priv->position);
-
-      return;
+      if (n_press == 1 && priv->single_click_activate)
+        {
+          gtk_widget_activate_action (GTK_WIDGET (self),
+                                      "list.activate-item",
+                                      "u",
+                                      priv->position);
+          return;
+        }
     }
 
   if (!priv->list_item || priv->list_item->selectable)